package com.fruits.login.model;

import org.hibernate.validator.constraints.Length;

import java.util.Date;

public class SmsCode {

    /**验证码:随机数*/
    private String code;

    @Length(max = 10)
    private String phone;

    /**生成验证码的时间*/
    private Date generateTime;

    public SmsCode(String code, String phone) {
        this.code = code;
        this.phone = phone;
        this.generateTime = new Date();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getGenerateTime() {
        return generateTime;
    }

    public void setGenerateTime(Date generateTime) {
        this.generateTime = generateTime;
    }

    @Override
    public String toString() {
        return "SmsCode{" + "code='" + code + '\'' + ", phone='" + phone + '\'' + ", generateTime=" + generateTime + '}';
    }
}
